import React from 'react';
import './css/base.css'
import ReactDOM from 'react-dom/client';
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
import Home from './Home/Home';
import LoginPage from './Login/LoginPage';
import Shop from './Home/Shop';
import Main from './Main';

//创建路由器
let router = createBrowserRouter([
    {
        path:'/',
        element:<Main></Main>,
        children:[
            {
                path:'',
                element: <Home></Home>
            },
            {
                path:'/shop',
                element: <Shop></Shop>
            }
        ]
    },
    {
        path:'/login/:id/:name',
        element:<LoginPage/>,
        
    }
])

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<RouterProvider router={router}/>);
